'use strict';

const Controller = require('egg').Controller;

class loginController extends Controller{
    async adminlogin(){
      const { ctx } = this;
      let admininfo = ctx.request.query;
      let data = await ctx.service.loginService.adminByNoAndPwd(admininfo);
      // console.log('adminlogin',data);
      ctx.body = data;
    }

    async userlogin(){
      const { ctx } = this;
      let userinfo = ctx.request.query;
      let data = await ctx.service.loginService.userByNoAndPwd(userinfo);
      // console.log(data);
      ctx.body = data;
    }
    async adminregister(){
      const { ctx } = this;
      let admininfo = ctx.request.body;
      let data = await ctx.service.loginService.adminregister(admininfo);
      // console.log('adminregister',data);
      ctx.body = data;
    }
}
module.exports = loginController;